<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>DotNetSecondDemo</title>
    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
</head>
<body>
    <div id="app">
        <h1>{{ msg }}</h1>
        <button @click="onGetValue">获取数据</button>
        <button @click="onGetValue">post数据</button>
    </div>
    <script>
        const { createApp,ref } = Vue
        var app = createApp({
            setup(){
                const msg = ref("Eternum" )
                const onGetValue = async ()=>{
                    // msg.value = "This your hometown"
                    // const res = await axios.get("http://localhost:5047/api/WeatherForecast/Get/get-name")
                    const postData = {
                        i: 3,
                        name: "Orionnnnn"
                    }
                    const res = await axios.post("http://localhost:5047/api/WeatherForecast/Post", postData)
                    msg.value = res.data
                }
                return {
                    msg,
                    onGetValue
                }  
            }
        })
        app.mount("#app")
    </script>
</body>
</html>